package com.BookManage;

import java.util.Objects;

public class Book {
    private String ISBN;
    private String name;
    private String author;
    private String address;
    private String date;
    private Integer price;

    public String getISBN() {
        return ISBN;
    }

    public void setISBN(String ISBN) {
        this.ISBN = ISBN;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Book(String ISBN, String name, String author, String address, String date, Integer price) {
        this.ISBN = ISBN;
        this.name = name;
        this.author = author;
        this.address = address;
        this.date = date;
        this.price = price;
    }

    public Book() {
    }
    public Book(String ISBN){
        this.ISBN = ISBN;
    }

    @Override
    public String toString() {
        return "Book{" +
                "ISBN=" + ISBN +
                ", name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", address='" + address + '\'' +
                ", date='" + date + '\'' +
                ", price=" + price +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Book)) return false;
        Book book = (Book) o;
        return Objects.equals(ISBN, book.ISBN) && Objects.equals(name, book.name) && Objects.equals(author, book.author) && Objects.equals(address, book.address) && Objects.equals(date, book.date) && Objects.equals(price, book.price);
    }

}
